/**
 * 
 */
package br.odb.libscene;

import br.odb.utils.math.Vec3;

/**
 * @author monty
 *
 */
public class ActorCommand {
	public Vec3 translate;
	public Vec3 rotate;
	public Vec3 scale;
	public int code;
	
	public ActorCommand() {
		translate = new Vec3();
		rotate = new Vec3();
		scale = new Vec3();
		
		code = ActorConstants.NOP;
		
		scale.set( 1.0f, 1.0f, 1.0f );
	}
	
	public static ActorCommand makeCommandFromCode( int cmdCode ) {
		ActorCommand toReturn = new ActorCommand();
		
		toReturn.code = cmdCode;
		
		switch ( cmdCode ) {
		case ActorConstants.MOVE_N:
			toReturn.translate.setZ(0.05f);
			break;
		case ActorConstants.MOVE_S:
			toReturn.translate.setZ(-0.05f);
			break;
		case ActorConstants.MOVE_W:
			toReturn.translate.setX(-0.05f);
			break;
		case ActorConstants.MOVE_E:
			toReturn.translate.setX(0.05f);
			break;
		case ActorConstants.MOVE_DOWN:
			toReturn.translate.setY(-0.05f);
			break;
		case ActorConstants.MOVE_UP:
			toReturn.translate.setY(0.05f);
			break;
		case ActorConstants.TURN_L:
			toReturn.rotate.setZ(0.45f);
			break;
		case ActorConstants.TURN_R:
			toReturn.rotate.setZ(-0.45f);
			break;
	
		}
		
		return toReturn;
	}
	
}
